<template>
  <div id="content">
    <div class="cinema_menu">
      <div class="city_switch">
        全城 <i class="iconfont icon-lower-triangle"></i>
      </div>
      <div class="brand_swtich">
        品牌 <i class="iconfont icon-lower-triangle"></i>
      </div>
      <div class="feature_switch">
        特色 <i class="iconfont icon-lower-triangle"></i>
      </div>
    </div>
    <div class="cinema_body">
      <ul>
        <li v-for="(item, index) in ciList" :key="index">
          <div>
            <span>{{ item.name }}</span>
            <span class="q"
              ><span class="price">{{ item.minPrice / 100 }}</span> 元起</span
            >
          </div>
          <div class="address">
            <span>{{ item.addr }}</span>
            <span>1763.5km</span>
          </div>
          <div class="card">
            <div
              v-for="(taa, key) in item.discounts"
              :key="key"
              :class="key | color"
              v-show="item.discounts[key] == 1"
            >
              {{ key | text }}
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ciList: [],
    };
  },
  async created() {
    let data = await this.$axios.get("/api/cinema");

    this.ciList = data.data.list;
    console.log(this.ciList);
  },
  filters: {
    text(key) {
      let textObj = {
        allowRefund: "认证",
        buyout: "上市",
        cityCardTag: "城市名片",
        deal: "政策",
        endorse: "促销",
        hallTypeVOList: "人气",
        sell: "销量",
        snack: "小吃",
        vipTag: "折扣卡",
      };
      return textObj[key];
    },
    color(key) {
      let colorObj = {
        allowRefund: "or",
        buyout: "or",
        cityCardTag: "or",
        deal: "or",
        endorse: "bl",
        hallTypeVOList: "bl",
        sell: "bl",
        snack: "bl",
        vipTag: "bl",
      };
      return colorObj[key];
    },
  },
};
</script>

<style scoped>
#content .login_body {
  width: 100%;
}
.login_body .login_text {
  width: 100%;
  height: 40px;
  border: none;
  border-bottom: 1px #ccc solid;
  margin-bottom: 5px;
  outline: none;
  text-indent: 10px;
}
.login_body .login_btn {
  height: 50px;
  margin: 10px;
}
.login_body .login_btn input {
  width: 100%;
  height: 100%;
  background: #e54847;
  border-radius: 3px;
  border: none;
  display: block;
  color: white;
  font-size: 20px;
}
.login_body .login_link {
  display: flex;
  justify-content: space-between;
}
.login_body .login_link a {
  text-decoration: none;
  margin: 0 5px;
  font-size: 12px;
  color: #e54847;
}
</style>